package com.ruoyi.system.domain;

import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.*;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.system.interfaces.Add;
import com.ruoyi.system.interfaces.Audit;
import com.ruoyi.system.interfaces.Update;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 护理记录表
 * @author jinyao
 */
@Data
@Table(name = "nursing_record")
public class NursingRecord {
    /**
     * 主键ID
     */
    @Id
    @Column(name = "id")
    @GeneratedValue(generator = "JDBC",strategy = GenerationType.IDENTITY)
    @NotNull(message = "主键ID不能为空", groups = {Update.class, Audit.class})
    private Long id;

    /**
     * 老人用户ID
     */
    @Column(name = "elder_user_id")
    @Excel(name = "老人用户ID")
    private Long elderUserId;

    /**
     * 老人姓名
     */
    @Column(name = "elder_name")
    @Excel(name = "老人姓名")
    @NotBlank(message = "老人姓名不能为空", groups = {Add.class})
    private String elderName;

    /**
     * 护理类型
     */
    @Column(name = "nursing_type")
    @Excel(name = "护理类型")
    @NotBlank(message = "护理类型不能为空", groups = {Add.class})
    private String nursingType;

    /**
     * 护理内容
     */
    @Column(name = "nursing_content")
    @Excel(name = "护理内容")
    @NotNull(message = "护理内容不能为空", groups = {Add.class})
    private String nursingContent;

    /**
     * 护理时间
     */
    @Column(name = "nursing_time")
    @Excel(name = "护理时间", dateFormat = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @NotNull(message = "护理时间不能为空", groups = {Add.class})
    private Date nursingTime;

    /**
     * 护士ID
     */
    @Column(name = "nurse_id")
    @Excel(name = "护士ID")
    @NotNull(message = "护士ID不能为空", groups = {Add.class})
    private String nurseId;

    /**
     * 护士姓名
     */
    @Column(name = "nurse_name")
    @Excel(name = "护士姓名")
    private String nurseName;

    /**
     * 状态（0正常 1停用）
     */
    @Column(name = "`status`")
    @Excel(name = "状态", readConverterExp = "0=正常,1=停用")
    @NotBlank(message = "状态不能为空", groups = {Add.class})
    private String status;

    /**
     * 护理费用
     */
    @Column(name = "nursing_fee")
    @Excel(name = "护理费用")
    @NotNull(message = "护理费用不能为空", groups = {Audit.class})
    @DecimalMin(value = "0.00" , message = "护理费用不能小于0", groups = {Audit.class})
    private BigDecimal nursingFee;

    /**
     * 审核状态（0待审核 1已通过 2已拒绝）
     */
    @Column(name = "audit_status")
    @Excel(name = "审核状态", readConverterExp = "0=待审核,1=已通过,2=已拒绝")
    @NotBlank(message = "审核状态不能为空", groups = {Audit.class})
    private String auditStatus;

    /**
     * 审核人
     */
    @Column(name = "audit_by")
    @Excel(name = "审核人")
    @NotBlank(message = "审核人不能为空")
    private String auditBy;

    /**
     * 审核时间
     */
    @Column(name = "audit_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Excel(name = "审核时间", dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date auditTime;

    /**
     * 审核备注
     */
    @Column(name = "audit_remark")
    @Excel(name = "审核备注")
    private String auditRemark;

    /**
     * 删除标志（0代表存在 2代表删除）
     */
    @Column(name = "del_flag")
    @Excel(name = "删除标志", readConverterExp = "0=存在,2=删除")
    private String delFlag;

    /**
     * 创建者
     */
    @Column(name = "create_by")
    @Excel(name = "创建者")
    private String createBy;

    /**
     * 创建时间
     */
    @Column(name = "create_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Excel(name = "创建时间", dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 更新者
     */
    @Column(name = "update_by")
    @Excel(name = "更新者")
    private String updateBy;

    /**
     * 更新时间
     */
    @Column(name = "update_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Excel(name = "更新时间", dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    /**
     * 备注
     */
    @Column(name = "remark")
    @Excel(name = "备注")
    private String remark;


    /**
     * 页数
     */
    @Transient
    private Integer pageNum = Constants.PAGE_NUM;

    /**
     * 页面数据条数
     */
    @Transient
    private Integer pageSize = Constants.PAGE_SIZE;

    /** 排序标识 */
    @Transient
    private String sort;

    /** 排序字段 */
    @Transient
    private String sortFiled;

}